In type theory, a type rule is a rule that describes how a type system assigns a type to a syntactic construction. These rules may be applied by the type system to determine if a program is well typed and what type expressions have.
The usual notation have the following general form
The first line are the premises that must be fulfilled for the rule to be applied, yielding the second line conclusion. This can be read as, if expression have type in environment (for all ), then an expression will have a environment and type .
For example, a simple language to perform arithmetic calculations on real numbers may have the following rules
A type rule may have no premises, and usually the line is dropped in these cases. A type rule may also specify change a environment by appending the changes to a previous existing environment, for example a declaration may have the following type rule:
This types can be used to derive composed expressions types, much like in natural deduction.